//
//  QPointsTwoCell.m
//  QoilPublic
//
//  Created by 杨凯 on 2017/3/17.
//  Copyright © 2017年 杨凯. All rights reserved.
//

#import "QPointsTwoCell.h"
@interface QPointsTwoCell ()
@property (weak, nonatomic) IBOutlet UIButton *signBtn;
@property (weak, nonatomic) IBOutlet UILabel *pointLab;//今日签到可领积分

@end
@implementation QPointsTwoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    _signBtn.layer.cornerRadius = 15;
    _signBtn.layer.masksToBounds = YES;
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

- (void)setModel:(QPointInfoListModel *)model{
    _model = model;
    
    _pointLab.text = [NSString stringWithFormat:@"今日签到可领%@积分",_model.today_integral];
    if ([_model.status isEqualToString:@"1"]) {
        [_signBtn setTitle:@"签到" forState:0];
        [_signBtn setBackgroundColor:[QColorUtility defaultBlueColor]];
        _signBtn.userInteractionEnabled=YES;
    }else{
        [_signBtn setTitle:@"已签到" forState:0];
        [_signBtn setBackgroundColor:[QColorUtility defaultLineColor]];
        _signBtn.userInteractionEnabled=NO;
    }
}

- (IBAction)signAction:(id)sender {
    if (self.signBlock) {
        self.signBlock();
    }
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
